package com.ihm.menu;

import java.util.ArrayList;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import com.ressources.Messages;

@ManagedBean
@ApplicationScoped
public class MenuIHMReferentiel {

	
	private ArrayList<MenuIHM> listMenu;
	private Messages menu = new Messages("com.ressources.menu");

	/**
	 * Constructeur
	 */
	public MenuIHMReferentiel(){
		
		listMenu = new ArrayList<MenuIHM>();
		listMenu.add(initNiveau1());
		listMenu.add(initNiveau2());
		listMenu.add(initNiveau3());
		listMenu.add(initNiveau4());
		listMenu.add(initNiveauNx());
	}
	
	/**
	 * Menu "Niveau 1"
	 * @return
	 */
	private MenuIHM initNiveau1(){		
		MenuIHM niveau1 = new MenuIHM();
		niveau1.setNomMenu("Niveau 1");
		ArrayList<BaliseLink> listeSSmn = new ArrayList<BaliseLink>();
		listeSSmn.add(new BaliseLink("Pression","Pression","a"));
		listeSSmn.add(new BaliseLink("Loi de dalton","loiDalton","a"));
		niveau1.setListeSousMenu(listeSSmn);
		
		return niveau1;
	}
	
	/**
	 * Menu "Niveau 2"
	 * @return
	 */
	private MenuIHM initNiveau2(){		
		MenuIHM niveau2 = new MenuIHM();
		niveau2.setNomMenu("Niveau 2");
		ArrayList<BaliseLink> listeSSmn = new ArrayList<BaliseLink>();
		listeSSmn.add(new BaliseLink("Les tables","LesTables","a"));
		listeSSmn.add(new BaliseLink("Accident","Accident","a"));		
		niveau2.setListeSousMenu(listeSSmn);		
		return niveau2;
	}
	
	/**
	 * Menu "Niveau 3"
	 * @return
	 */
	private MenuIHM initNiveau3(){		
		MenuIHM niveau3 = new MenuIHM();
		niveau3.setNomMenu("Niveau 3");
		ArrayList<BaliseLink> listeSSmn = new ArrayList<BaliseLink>();
		listeSSmn.add(new BaliseLink("Organisation","Organisation","a"));	
				
		niveau3.setListeSousMenu(listeSSmn);
		
		return niveau3;
	}
	

	/**
	 * Menu "Niveau 4"
	 * @return
	 */
	private MenuIHM initNiveau4(){		
		MenuIHM niveau4 = new MenuIHM();
		niveau4.setNomMenu("Niveau 4");
		
		ArrayList<BaliseLink> listeSSmn = new ArrayList<BaliseLink>();
		listeSSmn.add(new BaliseLink("Guide","Guide","a"));	
		
		niveau4.setListeSousMenu(listeSSmn);
		
		return niveau4;
	}
	

	/**
	 * Menu "Niveau 2"
	 * @return
	 */
	private MenuIHM initNiveauNx(){		
		MenuIHM nitrox = new MenuIHM();
		nitrox.setNomMenu(menu.getMessages("nitrox"));
		
		ArrayList<BaliseLink> listeSSmn = new ArrayList<BaliseLink>();
		listeSSmn.add(new BaliseLink(menu.getMessages("nitrox.ppName"),
										menu.getMessages("nitrox.ppLink"),
										menu.getMessages("nitrox.ppName")));	
		
		nitrox.setListeSousMenu(listeSSmn);
		
		return nitrox;
	}

	public ArrayList<MenuIHM> getListMenu() {
		return listMenu;
	}

	public void setListMenu(ArrayList<MenuIHM> listMenu) {
		this.listMenu = listMenu;
	}
	
	
}
